=========================================================================== BBS: The Abacus * HST/DS * Potterville MI Date: 06-14-93 (01:23) Number: 94 From: JIM LITTLE Refer#: NONE To: ERIC LOW Recvd: NO Subj: (1/4) Input routine Conf: (35) Quick Basi --------------------------------------------------------------------------- > *** As Jim Little blabbed to Bob Oehrle... (blabbed?) :) > JL> inputting too many characters. Unnumerable super-fancy input programs > JL> have been posted here in the past -- if you want, I'll give you mine.. > JL> just ask. > I'd like a copy of that, Jim. Thanx. Ok, here ya go: '______O_/__________________| SNIP |__________________\_O______ ' O \ | HERE | / O 'This file created by PostIt! v6.1. '>>> Start of page 1. 'These routines will input a line of text of up 32K, within the bounds ' of the window specified. If more text is inputted than there is room, ' the text scrolls. Insert, delete, home and end all perform expected ' functions. Color is not supported, but could be added without difficulty. 'A quirk: Although the text scrolls at 'right', an additional space is ' required for the cursor, and this space -will- overwrite anything at ' that location. So count on allowing at least one blank space beyond ' 'right'. 'This routine works without speed problems on my 386DX/40.. but I have ' not tested on anything slower. If anybody sees a problem, please let ' me know! 'Jim Little 'This code is not copyrighted. It may be used by anyone for any purpose. ' Merry Christmas. DECLARE SUB Printline (topletter AS INTEGER, text AS STRING,_ left AS INTEGER, right AS INTEGER) DECLARE SUB cInput (text AS STRING, left AS INTEGER, right AS_ INTEGER, length AS INTEGER, flag AS INTEGER) DECLARE SUB GetStroke (keystroke AS INTEGER) CONST kBackspace = 8 'ASCII values for some ' keys, as returned by GetStroke CONST kTab = 9 CONST kReturn = 13 CONST kEscape = 27 CONST kSpace = 32 CONST kInsert = -82 CONST kDelete = -83 CONST kHome = -71 CONST kEnd = -79 CONST kPageUp = -73 CONST kPageDown = -81 CONST kUpArrow = -72 CONST kDownArrow = -80 CONST kLeftArrow = -75 CONST kRightArrow = -77 CONST cOk = 0 'constants used by 'flag' ' in cInput CONST cUpArrow = 1 CONST cDownArrow = 2 CONST cPageUp = 3 CONST cPageDown = 4 CONST cEscape = 5 CONST cNull = 6 'Note: not returned by cInput CONST False = 0 CONST True = NOT False 'sample.. delete this and import remainder into your programs. CLS LOCATE , 32 PRINT "<-- Input scrolls at this point."; text$ = "This is a test" cInput text$, 1, 30, 80, flag% PRINT : PRINT PRINT "Text recieved: "; text$ PRINT PRINT "Input terminated with "; SELECT CASE flag% CASE cOk PRINT "a return." CASE cUpArrow PRINT "the up arrow." CASE cDownArrow PRINT "the down arrow." CASE cPageUp PRINT "a page up." CASE cPageDown PRINT "a page down." CASE cEscape PRINT "escape." '>>> Continued on page 2 --- * Origin: The Radix Point: Astoria, OR (1:105/330.9) SEEN-BY: 1/211 11/2 4 13/13 101/1 108/89 109/25 110/69 114/5 123/19 124/1 SEEN-BY: 153/752 154/40 77 157/110 159/100 125 430 575 950 203/23 209/209 SEEN-BY: 261/1023 280/1 390/1 396/1 15 397/2 2230/100 2440/5 3603/20